home *** CD-ROM | disk | FTP | other *** search
/ China's Education / China's Education.iso / images / CHST.js < prev    next >
Text File  |  2004-06-08  |  2KB  |  84 lines

  1. var imgHover=new Image();
  2. imgHover.src="/images/arrow_hover.gif";
  3. function chgImg(n) {
  4.     var img = eval("img"+n);
  5.     img.src=imgHover.src;
  6. }
  7.  
  8. function restoreImg(n) {
  9.     var img = eval("img"+n);
  10.     img.src="/images/arrow.gif";
  11. }
  12.  
  13. // =============================================================
  14. // ╣÷╢»─┌╚▌▓┐╖╓
  15.  
  16. var iTimer;
  17. // oScrollDivHeight ╡╚╙┌╣÷╢»─┌╚▌▓┐╖╓▓π╡─╕▀╢╚
  18. var oScrollDivHeight = 115;
  19. // oScrollBarHeight ╡╚╙┌╣÷╢»╠⌡▓┐╖╓╡─╕▀╢╚╝⌡╚Ñ╗¼┐Θ╡─╕▀╢╚
  20. var oScrollBarHeight = 81;
  21. // oTime ╬¬╣÷╢»╞╡┬╩
  22. var oTime = 100;
  23. function downIt()
  24. {
  25. //alert(mq.scrollHeight)
  26. clearInterval(iTimer);
  27.  
  28. iTimer = setInterval("mq.doScroll('down');divImg.style.top=mq.scrollTop*oScrollBarHeight/(mq.scrollHeight-oScrollDivHeight)", oTime);
  29.  
  30. }
  31. function upIt()
  32. {
  33. clearInterval(iTimer);
  34. iTimer = setInterval("mq.doScroll('up');divImg.style.top=divImg.style.top=mq.scrollTop*oScrollBarHeight/(mq.scrollHeight-oScrollDivHeight)", oTime);
  35. }
  36.  
  37. var scroll,oldY=0;
  38.  
  39. function startScroll(){
  40.     scroll=true;
  41.     divImg.setCapture();
  42.  
  43.     if (oldY==0) oldY = event.y;
  44. }
  45.  
  46. function scrollIt()
  47. {
  48.     if (scroll==true && event.y>=oldY && event.y<=oScrollBarHeight+oldY && mq.scrollHeight>oScrollDivHeight){
  49.     divImg.style.top=event.y-oldY;
  50.     mq.scrollTop = (event.y-oldY)/oScrollBarHeight*(mq.scrollHeight-oScrollDivHeight);
  51. }}
  52.  
  53. function stopScroll(){
  54.     document.releaseCapture();
  55.     scroll=false;
  56. }
  57.  
  58. // =============================================================
  59. // ╡╝║╜▓╦╡Ñ▓┐╖╓
  60. var menu = new Array;
  61. menu[0] = "menuBase";
  62. menu[1] = "menuAdvance";
  63. menu[2] = "menuLinian";
  64. menu[3] = "menuDown";
  65.  
  66. function showMenu(n){
  67.     var obj = eval(menu[n]);
  68.     
  69.     if(obj.style.visibility=="visible") return;
  70.  
  71.     obj.style.visibility="visible";
  72.  
  73.     for (i=0;i<4;i++){
  74.         mObj = eval(menu[i]);
  75.         if (i!=n) mObj.style.visibility="hidden";
  76. }}
  77.  
  78. function hideMenu(n) {
  79.     var obj = eval(menu[n]);
  80.     obj.style.visibility="hidden";
  81.  
  82. }
  83.  
  84.